Instruction for implementing vector loops of iterations having an iteration dependent condition

ABSTRACT

A processor is described having an instruction execution pipeline. The instruction execution pipeline includes an instruction fetch stage to fetch an instruction. The instruction identifies an input vector operand whose input elements specify one or the other of two states. The instruction execution pipeline also includes an instruction decoder to decode the instruction. The instruction execution pipeline also includes a functional unit to execute the instruction and provide a resultant output vector. The functional unit includes logic circuitry to produce an element in a specific element position of the resultant output vector by performing an operation on a value derived from a base value using a stride in response to one but not the other of the two states being present in a corresponding element position of the input vector operand.

FIELD OF INVENTION

The field of invention pertains to the computing sciences, and, morespecifically, to an instruction for implementing iterations having aniteration dependent condition with a vector loop.

BACKGROUND

FIG. 1 shows a high level diagram of a processing core 100 implementedwith logic circuitry on a semiconductor chip. The processing coreincludes a pipeline 101. The pipeline consists of multiple stages eachdesigned to perform a specific step in the multi-step process needed tofully execute a program code instruction. These typically include atleast: 1) instruction fetch and decode; 2) data fetch; 3) execution; 4)write-back. The execution stage performs a specific operation identifiedby an instruction that was fetched and decoded in prior stage(s) (e.g.,in step 1) above) upon data identified by the same instruction andfetched in another prior stage (e.g., step 2) above). The data that isoperated upon is typically fetched from (general purpose) registerstorage space 102. New data that is created at the completion of theoperation is also typically “written back” to register storage space(e.g., at stage 4) above).

The logic circuitry associated with the execution stage is typicallycomposed of multiple “execution units” or “functional units” 103_1 to103_N that are each designed to perform its own unique subset ofoperations (e.g., a first functional unit performs integer mathoperations, a second functional unit performs floating pointinstructions, a third functional unit performs load/store operationsfrom/to cache/memory, etc.). The collection of all operations performedby all the functional units corresponds to the “instruction set”supported by the processing core 100.

Two types of processor architectures are widely recognized in the fieldof computer science: “scalar” and “vector”. A scalar processor isdesigned to execute instructions that perform operations on a single setof data, whereas, a vector processor is designed to execute instructionsthat perform operations on multiple sets of data. FIGS. 2A and 2Bpresent a comparative example that demonstrates the basic differencebetween a scalar processor and a vector processor.

FIG. 2a shows an example of a scalar AND instruction in which a singleoperand set, A and B, are ANDed together to produce a singular (or“scalar”) result C (i.e., AB=C). By contrast, FIG. 2b shows an exampleof a vector AND instruction in which two operand sets, A/B and D/E, arerespectively ANDed together in parallel to simultaneously produce avector result C, F (i.e., A.AND.B=C and D.AND.E=F). As a matter ofterminology, a “vector” is a data element having multiple “elements”.For example, a vector V=Q, R, S, T, U has five different elements: Q, R,S, T and U. The “size” of the exemplary vector V is five (because it hasfive elements).

FIG. 1 also shows the presence of vector register space 107 that isdifferent than general purpose register space 102. Specifically, generalpurpose register space 102 is nominally used to store scalar values. Assuch, when any of the execution units perform scalar operations theynominally use operands called from (and write results back to) generalpurpose register storage space 102. By contrast, when any of theexecution units perform vector operations they nominally use operandscalled from (and write results back to) vector register space 107.Different regions of memory may likewise be allocated for the storage ofscalar values and vector values.

FIGURES

A better understanding of the present invention can be obtained from thefollowing detailed description in conjunction with the followingdrawings, in which:

FIG. 1 shows an instruction execution pipeline;

FIGS. 2a and 2b compare scalar vs. vector processing;

FIG. 3 shows an iterative process that determines the state of acondition within each iteration;

FIG. 4 shows a diagram of an improved instruction sequence that uses aconditional increment instruction to implement an iterative process thatdetermines a state of a condition within each iteration within a vectorloop;

FIG. 5a shows a first embodiment of a logic circuit for a functionalunit that performs a conditional increment instruction;

FIG. 5b shows a second embodiment of a logic circuit for a functionalunit that performs a conditional increment instruction;

FIG. 6a is a block diagram illustrating a generic vector friendlyinstruction format and class A instruction templates thereof accordingto embodiments of the invention.

FIG. 6b is a block diagram illustrating the generic vector friendlyinstruction format and class B instruction templates thereof accordingto embodiments of the invention.

FIGS. 7a-d are block diagrams illustrating an exemplary specific vectorfriendly instruction format according to embodiments of the invention.

FIG. 8 is a block diagram of a register architecture according to oneembodiment of the invention.

FIG. 9a is a block diagram of a single CPU core, along with itsconnection to the on-die interconnect network and with its local subsetof the level 2 (L2) cache, according to embodiments of the invention.

FIG. 9b is an exploded view of part of the CPU core in FIG. 9A accordingto embodiments of the invention.

FIG. 10a is a block diagram illustrating an exemplary out-of-orderarchitecture according to embodiments of the invention.

FIG. 10b is a block diagram illustrating an exemplary out-of-orderarchitecture according to embodiments of the invention.

FIG. 11 is a block diagram of a system in accordance with one embodimentof the invention.

FIG. 12 is a block diagram of a second system in accordance with anembodiment of the invention.

FIG. 13 is a block diagram of a third system in accordance with anembodiment of the invention.

FIG. 14 is a block diagram of a SoC in accordance with an embodiment ofthe invention.

FIG. 15 is a block diagram of a single core processor and a multicoreprocessor with integrated memory controller and graphics according toembodiments of the invention.

FIG. 16 is a block diagram contrasting the use of a software instructionconverter to convert binary instructions in a source instruction set tobinary instructions in a target instruction set according to embodimentsof the invention.

DETAILED DESCRIPTION

Iterative processes can frequently be “sped up” or otherwise made moreefficient through the implementation of a vector loop. In order toimplement a vector loop one or more vectors are created where elementsin the vectors represent different iteration cycles. For example, afirst element in a vector represents a first iteration, a second elementin the vector represents a second iteration, etc. By performing vectoroperations on these vectors multiple iterations can be effectivelyperformed in parallel (e.g., simultaneously).

Iterative processes of the form depicted in FIG. 3, however, arecurrently not able to be compiled into a vector loop. The iterative formdepicted in FIG. 3 tends to be found in various applications such asmolecular dynamic codes or numerical weather simulation.

FIG. 3 shows an iterative process controlled by a variable “i”. That is,i increments (or decrements) 301 with each iteration. After N iterations306 the process stops 307. As part of each iteration an inquiry is madeinto whether a condition is “true” or “not true” 302. The condition canbe true or not true as a function of i. That is, the condition may betrue for one iteration yet not be true for another iteration. The set ofcircumstances and/or processes that determine whether the condition istrue or not for any iteration (value of i) can be practically unlimited.

An iteration whose condition is true will behave differently than aniteration whose condition is not true. If the condition is true avariable n is incremented by a stride value s 303. Here, s can be anyvalue and n can have any initial value. For example, if s=1 and theinitial value of n is 0, n will increment according to the pattern 0, 1,2, 3, . . . each time the condition is true. By contrast, if s=3 and theinitial value of n is 0, n will increment according to the pattern 0, 3,6, 9, . . . each time the condition is true.

Again, the condition may be true for various values of i. For example,the condition may be true for the first iteration and then not be trueagain until the tenth iteration. Thus n will remain constant for thesecond through ninth iterations. Thus n provides some reflection of howmany times the condition has been true over the course of theiterations. As alluded to above, the variable of n is also typicallyprovided with an initial value (e.g., n=0) before the start of theiterative sequence.

Regardless if the condition is true or not, each iteration willdetermine a variable x based on n 304. Specifically, there is understoodto be an array A (e.g., a large vector A) and x assumes the value of alocation in A based on n (x=A[n]). Thus, for each iteration, n acts asan index into A that determines a value of x. If the condition is nottrue for a particular iteration, x will assume the same value that itdid as the previous iteration (because if the condition is not true, ndid not increment to another, new index value into A).

With x being determined, the computation for the result of the iterationis finally performed 305. That is, the result is a function of x. Inother cases the result computation may, along with x, also be a functionof i (the iteration count) and/or the value of n (the measurement of thenumber of true conditions over the iterations). Here, as with thecondition, the result computation 305 may be implemented with any of apractically unlimited number of computational processes. When all of theiterations have executed, the result is N computation results.

Unfortunately, because of the complexity of the iterative process,particularly the inquiry into the condition 302, the increment of n by sif the condition is true 303 and the use of n as an index into A,compilers have difficulty compiling processes of the form of FIG. 3 intoa vector loop. Thus the present application describes a new instructionthat permits compilers to more easily compile the iterative process ofFIG. 3 into a vector loop.

FIG. 4 shows an embodiment of a program code structure and flow thatutilizes the new instruction to implement the iterative process of FIG.3 with a vector loop.

As observed in FIG. 4 the program code creates a vector, referred to asthe “loop vector” (LV), whose elements represent progression through theiterations 401. In an embodiment, a neighboring element locationrepresents a “next” iteration relative to the element location that itneighbors, and, the values of the loop vector's elements correspond to a“loop count”. For example, in an embodiment in which the loop vector isimplemented as an eight element vector, the loop vector could beinstantiated with the following content to represent the first eightiterations of the iterative process:LV<=7 6 5 4 3 2 1 0  Eqn. 1.

Over the course of the iterations, the loop vector would be updatedbetween the eighth and ninth iterations to represent the ninth throughsixteenth iteration as follows:LV<=15 14 13 12 11 10 9 8  Eqn. 2.

The contents of LV can therefore be viewed, at least is someimplementations, as the value of i over the course of the iterations insequence.

The program code also creates a second vector, the “conditional vector”(CV), whose elements indicate whether the condition is true (or nottrue) on any particular iteration 402. Like the loop vector LV, in anembodiment, a neighboring element location within the conditional vector(CV) represents a “next” iteration relative to the element location thatit neighbors. However, unlike the loop vector LV, the elements of the CVindicate whether the condition of its respective iteration is true ornot. For example, in an embodiment in which a true is represented with a1 and not true is represented with a 0, in a process where the conditionis true for the fourth and seventh iterations but no other iterationswithin the first eight iterations, the conditional vector may take thefollowing form:CV<=0 1 0 0 1 0 0 0  Eqn. 3.Over course of the iterations, the conditional vector would be updatedbetween the eighth and ninth iterations to reflect the conditions overthe course of the ensuing ninth through sixteenth iterations. Forexample, if the condition is true for the tenth and twelfth iterationsbut no other iterations within the ninth through sixteenth iterations,the updated conditional vector would take the following form:CV<=0 0 0 0 1 0 1 0  Eqn. 4.

The new instruction alluded to above (CONDINC) is executed 403 after theconditional vector is created 402. The CONDINC instruction accepts theconditional vector as an input operand and returns as a resultant athird vector, referred to as the “n vector” (NV), whose contentrepresents the value of n over the course of the iterations.

In an embodiment, like the loop vector LV and conditional vector CV, aneighboring element location within the n vector NV represents a “next”iteration relative to the element location that it neighbors. However,unlike either of the loop vector LV or conditional vector CV, the nvector NV demonstrates the increment of n by the stride s each time thecondition is true across the iterations. For example if the conditionalvector CV specified above in Eqn. 3 applies across the first eightiterations, the CONDINC instruction would provide the followingresultant for an initial value of n of 0, a stride s of 3 and an inputvector operand CV as specified in Eqn. 4:NV<=6 6 3 3 3 0 0 0  Eqn. 5.Continuing with the example, if the conditional vector CV of Eqn. 4applies for the ninth through sixteenth iterations, the CONDINCinstruction would provide the following resultant:NV<=12 12 12 12 12 9 9 6  Eqn. 6.

Note that the value of n from the eighth iteration (leftmost value of NVof Eqn. 5=6) carries over to the value of n for the ninth iteration(rightmost value of NV of Eqn. 6=6). As will be described in more detailbelow, the “carry over” of a value of n from an immediately precedingiteration as determined from an immediately preceding execution of theCONDINC instruction can be accepted as an input operand for the CONDINCinstruction.

Subsequent to the execution of the CONDINC instruction, one or moreinstructions (e.g., vector instructions) are executed 404 to determine afourth vector, referred to as the “x vector” (XV) which establishes thevalues of x across the progression of iterations. Recalling that n actsas an index into the array A, the one or more instructions 404essentially return in vector format the values of A corresponding toindex locations provided by the n vector (NV). For example, if the firsteight values of A are as provided below:A[7:0]=128 64 32 16 8 4 2 1  Eqn. 7and if the n vector NV of Eqn. 5 is taken by instruction processing 404as the corresponding vector input operand, the corresponding x vector XVproduced by instruction processing 404 will be as follows:XV<=64 64 8 8 8 1 1 1  Eqn. 8.The one or more instructions utilized in performing process 404 mayinclude, for instance, a gather instruction. A gather instruction is aninstruction that extracts elements from an array based on input indexvalues.

With the creation of the loop vector LV in Eqn. 1, the n vector NV inEqn. 5 and the x vector XV in Eqn. 8, the input variables for the firsteight iterations of the process of FIG. 3 are set up in vector form.These equations are repeated below for convenience.LV<=7 6 5 4 3 2 1 0  Eqn. 1.NV<=6 6 3 3 3 0 0 0  Eqn. 5.XV<=64 64 8 8 8 1 1 1  Eqn. 8.Here, a same positioned set of elements across the three vectors abovecorrespond to the correct i, n and x values for the particular iterationthat they represent. That is, for example, the rightmost (first) elementposition across the LV, NV and XV vectors correspond to the correct setof i, n and x values for the first iteration of the process of FIGS. 3(i=0, n=0 and x=1), the fourth element position across the LV, NV and XVvectors correspond to the correct set of i, n and x values for thefourth iteration of the process of FIG. 3 (i=3, n=3, x=8), etc.

As such, with the creation of these vectors, the instruction sequence isfinally prepared to perform the resultant computation 405 as a vectoroperation if desired. Again, the resultant computation 405 canpractically be any of an unlimited number of different computations.Ultimately, however, in an embodiment, the result of result computation405 will be result(i) in vector format for the first eight iterations.That is, if the syntax RS(i) is used to specify “result(i)” (i.e., theresult of the ith iteration), the resultant from the processingperformed by block 405 will be the result vector RV as follows:RV<=RS(7)RS(6)RS(5)RS(4)RS(3)RS(2)RS(1)RS(0)  Eqn. 9.

After RV is computed as provided just above for the first eightiterations of the process of FIG. 3, a next vector loop of theinstruction sequence of FIG. 4 can be performed that will produce Eqn. 2for the i values and Eqn. 6 for the n values. Using the n vector of FIG.4 as the input for the next computation of process 404 for the secondloop will generate a corresponding x vector XV for the eighth throughsixteenth iterations. This will produce another set of LV, NV and XVvectors for the result computation 405 of the second vector loop. Theloop vectors of FIG. 4 then repeat as described above until the numberof desired iterations is complete.

Although the above example was described in reference to vector sizes ofeight elements, it should be understood that the same process describedabove can readily be extended to other vector sizes (e.g., vector sizesof 16, 32, 64, 128, 256, 512, etc.).

The above discussion also considered as a main embodiment the adding ofa stride. That is, n=n+s. In one embodiment, a vector processor thatsupports the new CONDINC instruction supports a general form of theinstruction: CONDINCOP. Here, the CONDINCOP instruction (“conditionalincrement operation”) corresponds to essentially the same instructionalprocess as in the preceding example above, but with an update of n byany type of reduction operation, e.g. n=n OP s, where OP is one ofarithmetical operations (+, −, *, /), bit manipulation operation(<<, >>, etc), logical operation (or, and, nor, xor, etc.). The type ofoperation may be encoded as an additional immediate input operand, ormay be encoded in the opcode of operation. For example,

CONDINCOP k1, zmmsrc1, zmmsrc2, zmmdest, op n=zmmsrc1[KL−1]; //n = basevalue for(i=0; i<KL; i++){  if(k1[i]==1) n=n op zmmsrc2[i];  zmmdest[i]= n; }Here k1 is a conditional vector (CV), zmmsrc1 provides a base value asone of the elements of the vector or as a scalar (as will be describedhereafter), zmmsrc2 provides a second operand for the update operationof the n value, zmmdest is a resulting NV vector.

In alternative or even further combined embodiments, two other forms ofthe CONDINC instruction are provided for iterative processes thatdeviate from the form of FIG. 3 into a “post increment” form. That is,FIG. 3 shows a process where, for the ith iteration, n is incrementedbefore the resultant computation 305 if the condition for the ithiteration is true.

By contrast, an alternative form of iterative process may exist inwhich, for the ith iteration, n is incremented after the resultantcomputation 305 if the condition for the ith iteration is true. Thistype of process can easily be envisioned by moving blocks 304 and 305ahead of blocks 302 and 303 in FIG. 3, and, blocks 404 and 405 ahead ofblocks 402 and 403 in FIG. 4. In this case, each iteration i ends withan increment of n or no increment of n depending on the condition for i.This has the effect of causing the next iteration i+1 to use a value nthat is incremented by the stride s as compared to the value n used foriteration i (if iteration i indexes into array A with an index of n andthe condition for the ith iteration is true, then iteration i+1 willindex into array A with an index of n+s).

According to this post increment approach, in order to produce thecorrect values of n for the ith iteration, another instructionCONDINCPOST will show an increment of n in the i+1element of the nvector resultant NV rather than the ith element (as is done with theCONDINC instruction). For example, recall that for a condition vector CVinput operand ofCV<=0 1 0 0 1 0 0 0  Eqn. 3.The CONDINC instruction produced an NV resultant ofNV<=6 6 3 3 3 0 0 0  Eqn. 5.By contrast, if the CONDINCPOST instruction received the same CV inputvector as provided in Eqn. 3 above (and with an initial value of n=0 andwith a stride of 3), the NV resultant would be:NV<=6 3 3 3 0 0 0 0  Eqn. 10.

In an embodiment of the CONDINCPOST instruction, if the last (highest)element of the CV input vector indicates the condition is true, theinstruction is designed to set a carry term into control register spaceso that the immediately following CONDINCPOST instruction will know toincrement its first (lowest) output NV vector element. In furtherembodiments, there is also a generalized version of CONDINCPOST:CONDINCPOSTOP. As with CONDINCOP, CONDINCPOSTOP regards the operationtype as encoded input operand and updates n by performing this operationwith each true condition (n=n OP s) but with the post incrementfunction.

A compiler therefore can recognize the existence of either the normalformat of FIG. 3 or the post increment format described above and inserta CONDINC instruction into the instruction stream consistent with theprinciples described above. Note that some forms of the iterativeprocess of FIG. 3 (or the corresponding post increment process) may notuse i and/or n as explicit input values for the result computation 305(the result computation still uses x as an input value). Alternatively,the iterative process of FIG. 3 may not use n as an index for accessingarray values 304, and the resultant computation may not depend of x.Moreover, n may be not an integer value, but any floating point value,updated by floating point operation with a floating point stride andbase values.

Any form of any of the instructions discussed above may not even includethe base and/or the stride as input operands (e.g., an instruction thathas hardcoded in its operation a base value of 0 and a stride of 1).

FIG. 5a shows an embodiment of a core logic circuit for a functionalunit that is designed to perform a CONDINC instruction. According to theparticular design of FIG. 5a , the singular core logic circuit isinstantiated only once within the functional unit such that thedifferent elements of the resultant vector are each individuallyprocessed by the single circuit. According to this approach, the outputvector of the instruction is formed by way of the functional unitcontrolling its own sequence of internal loops that iterate through thecircuit (once per output vector elements). Other more parallelizedapproaches are also possible which are described in more detail withrespect to FIG. 5 b.

As observed in FIG. 5a , the functional unit includes a firstmultiplexer 501, which feeds its result into an ALU 503, and through abypass into a second multiplexer 502. The result of ALU 503 also feedsinto the second multiplexer 502. The first multiplexer 501 provides a“base” value as a second operand of the ALU 503 and as a second operandof the second multiplexer 501 if the first (lowest ordered) element ofthe resultant vector is being processed. Thus, the base valuecorresponds to the initial value of n if the instruction is processingthe first sequence of iterations, otherwise, the base value correspondsto the carried over n value from the immediately prior CONDINCinstruction that was executed. Once the first resultant element isprocessed, the output is stored and provided back to the ALU 503 throughthe first multiplexer 501.

A first operand of the ALU 503 is provided with stride s. ALU 503performs an increment operation on the first and the second operands andprovides the result as a first operand of the second multiplexer 502.

The second multiplexer 502 returns result of the ALU 503 as a finalresult if the vector element position being processed has a conditionalvector CV element value of 1. Otherwise, the second multiplexer 502returns the second operand of the ALU 503 as a final result, which isbypassed to the second operand of the second multiplexer 502. By sodoing, in calculating the n value for the resultant vector elementposition currently being processed, multiplexer 502 causes an incrementby s of the immediately prior n value if the corresponding element has atrue condition, or, keeps the immediately prior n value if thecorresponding element is not true. Here, the functional unit accepts aconditional vector CV as an input operand and a next element in the CVinput operand is provided to multiplexer 502 in succession with eachinternal loop of the functional unit that processes a next resultantvector element position.

The base value and the stride s can each be accepted as a scalar, or, avector of repeating base values and a vector of stride valuesrespectively as additional vector operands. For example, if thefunctional unit provides an eight element vector as the resultant andthe stride value is 3, the stride input vector may be created as 3 3 3 33 3 3 3. In this case, the functional unit takes each stride value fromeach next element in succession as is done with the conditional vectorinput operand. Likewise, the base value input vector may be crafted as bb b b b b b b. Here, however, only one of the elements is accepted as aninput operand value and processed (for the processing of the firstelement in the resultant). Alternatively, base and stride values may beprovided as immediate scalar operands within the instruction format ormay be passed as scalars within a vector input operand format (e.g., “XX X X X X X s” for the input vector operand that provides the stridevalue). For iterations other than the very first sequence of iterations,as alluded to previously, the base value be may provided from controlvector register space that holds the b value as a carry term providedfrom the immediately prior executed CONDINC instruction).

The above discussion with respect to FIG. 5a was directed to theimplementation of a CONDINC instruction that processed each element inthe vector resultant in serial fashion. The same circuit and approach asdescribed above can also be used to implement a CONDINCOP instruction asthe ALU 503 may perform not only addition but any other operation.

A CONDINCPOST instruction can be implemented (any type of operation bytaking appropriate ALU 503) by providing the value from the i−1thelement of the conditional vector input operand to the channel selectinput of the second multiplexer 502 during processing of the ithiteration. For example, if the i=4 resultant vector element is currentlybeing processed, the channel select input of multiplexer 502 receivesthe value from the i−1=3 element position of the conditional vector. Forthe very first iteration (i=0) condition is assumed to be false tobypass the ALU 503.

FIG. 5b shows a core logic circuit for a parallelized implementation ofthe CONDINC instruction. The core circuitry of the parallelized circuitis similar to the circuit of FIG. 5a except that the resultant outputsare chained over to an input of the ALU and an input of the secondmultiplexer of the next element position. If there is one core circuitper resultant output vector element, the core circuit for the firstelement position does not need a first multiplexer (the base value ispropagated directly to its ALU). If there are less core circuits thanoutput vector elements (e.g., there are four core circuits and eightoutput vector elements such that two functional unit cycles aresufficient to process the entire resultant (a first cycle producesoutput elements 0-3 and a second cycle produces output elements 4-7)),the first core circuit can include a first multiplexer and receive theoutput from the farthest resultant on the other side of the block ofcore circuits (to ripple the latest value of n forward in the chain).The circuit can receive multiple elements from the conditional vectorinput operand in parallel and process them in an aligned fashion asdepicted in FIG. 5 b.

The above discussion with respect to FIG. 5b was directed to theimplementation of a CONDINC instruction that can potentially processmultiple elements of the vector resultant simultaneously. The samecircuit and approach as described above in FIG. 5b can also be used toimplement a CONDINCOP instruction with any type of increment operationby taking an appropriate ALU block.

A CONDINCPOSTOP instruction can be implemented (with any type ofincrement operation specified by the ALU used) by providing the i−1thvalue from the conditional vector input operand to the channel selectinput of the second multiplexer to the core circuit that processes theith element of the resultant vector. For example, the core circuit thatprocesses the i=4 resultant vector element receives the content of thei−1=3 element position of the conditional vector. For the very firstiteration (i=0) condition is assumed to be false to bypass the ALU 503.

In any/all of the embodiments above, the conditional vector is providedfrom mask register space (thus created conditional vectors are stored inmask vector register space) even though the conditional vector is nothandled as a traditional write-mask. In various embodiments the strideis specified as an input operand (e.g., an immediate operand). Althoughin some embodiments the stride may be assumed to be equal to 1 (or otherpredefined value), which may save an additional input operand. In thesame manner the base element may be assumed to be equal to 0 (or otherpredefined value) and save another input operand.

Embodiments of the instruction(s) detailed above may be at leastpartially embodied in a “generic vector friendly instruction format”which is detailed below. Additionally, exemplary systems, architectures,and pipelines are detailed below. Embodiments of the instruction(s)above may be executed on such systems, architectures, and pipelines, butare not limited to those detailed.

A vector friendly instruction format is an instruction format that issuited for vector instructions (e.g., there are certain fields specificto vector operations). While embodiments are described in which bothvector and scalar operations are supported through the vector friendlyinstruction format, alternative embodiments use only vector operationsthe vector friendly instruction format.

Exemplary Generic Vector Friendly Instruction Format—FIG. 6A-B

FIGS. 6a-b are block diagrams illustrating a generic vector friendlyinstruction format and instruction templates thereof according toembodiments of the invention. FIG. 6a is a block diagram illustrating ageneric vector friendly instruction format and class A instructiontemplates thereof according to embodiments of the invention; while FIG.6b is a block diagram illustrating the generic vector friendlyinstruction format and class B instruction templates thereof accordingto embodiments of the invention. Specifically, a generic vector friendlyinstruction format 600 for which are defined class A and class Binstruction templates, both of which include no memory access 605instruction templates and memory access 620 instruction templates. Theterm generic in the context of the vector friendly instruction formatrefers to the instruction format not being tied to any specificinstruction set. While embodiments will be described in whichinstructions in the vector friendly instruction format operate onvectors that are sourced from either registers (no memory access 605instruction templates) or registers/memory (memory access 620instruction templates), alternative embodiments of the invention maysupport only one of these. Also, while embodiments of the invention willbe described in which there are load and store instructions in thevector instruction format, alternative embodiments instead oradditionally have instructions in a different instruction format thatmove vectors into and out of registers (e.g., from memory intoregisters, from registers into memory, between registers). Further,while embodiments of the invention will be described that support twoclasses of instruction templates, alternative embodiments may supportonly one of these or more than two.

While embodiments of the invention will be described in which the vectorfriendly instruction format supports the following: a 64 byte vectoroperand length (or size) with 32 bit (4 byte) or 64 bit (8 byte) dataelement widths (or sizes) (and thus, a 64 byte vector consists of either16 double word-size elements or alternatively, 8 quadword-sizeelements); a 64 byte vector operand length (or size) with 16 bit (2byte) or 8 bit (1 byte) data element widths (or sizes); a 32 byte vectoroperand length (or size) with 32 bit (4 byte), 64 bit (8 byte), 16 bit(2 byte), or 8 bit (1 byte) data element widths (or sizes); and a 16byte vector operand length (or size) with 32 bit (4 byte), 64 bit (8byte), 16 bit (2 byte), or 8 bit (1 byte) data element widths (orsizes); alternative embodiments may support more, less and/or differentvector operand sizes (e.g., 656 byte vector operands) with more, less,or different data element widths (e.g., 128 bit (16 byte) data elementwidths).

The class A instruction templates in FIG. 6A include: 1) within the nomemory access 605 instruction templates there is shown a no memoryaccess, full round control type operation 610 instruction template and ano memory access, data transform type operation 615 instructiontemplate; and 2) within the memory access 620 instruction templatesthere is shown a memory access, temporal 625 instruction template and amemory access, non-temporal 630 instruction template. The class Binstruction templates in FIG. 6B include: 1) within the no memory access605 instruction templates there is shown a no memory access, write maskcontrol, partial round control type operation 612 instruction templateand a no memory access, write mask control, vsize type operation 617instruction template; and 2) within the memory access 620 instructiontemplates there is shown a memory access, write mask control 627instruction template.

Format

The generic vector friendly instruction format 600 includes thefollowing fields listed below in the order illustrated in FIGS. 6a-b .In conjunction with the discussions above concerning FIGS. 4, 5 a and 5b, in an embodiment, referring to the format details provided below inFIGS. 6a-b and 7, either a non memory access instruction type 605 or amemory access instruction type 620 may be utilized. Addresses for theinput vector operand(s) and destination may be identified in registeraddress field 644 described below. The instructions may be formatted tobe destructive or non destructive.

Format field 640—a specific value (an instruction format identifiervalue) in this field uniquely identifies the vector friendly instructionformat, and thus occurrences of instructions in the vector friendlyinstruction format in instruction streams. Thus, the content of theformat field 640 distinguish occurrences of instructions in the firstinstruction format from occurrences of instructions in other instructionformats, thereby allowing for the introduction of the vector friendlyinstruction format into an instruction set that has other instructionformats. As such, this field is optional in the sense that it is notneeded for an instruction set that has only the generic vector friendlyinstruction format.

Base operation field 642—its content distinguishes different baseoperations. As described later herein, the base operation field 642 mayinclude and/or be part of an opcode field.

Register index field 644—its content, directly or through addressgeneration, specifies the locations of the source and destinationoperands, be they in registers or in memory. These include a sufficientnumber of bits to select N registers from a P×Q (e.g. 32×1012) registerfile. While in one embodiment N may be up to three sources and onedestination register, alternative embodiments may support more or lesssources and destination registers (e.g., may support up to two sourceswhere one of these sources also acts as the destination, may support upto three sources where one of these sources also acts as thedestination, may support up to two sources and one destination). Whilein one embodiment P=32, alternative embodiments may support more or lessregisters (e.g., 16). While in one embodiment Q=1012 bits, alternativeembodiments may support more or less bits (e.g., 128, 1024).

Modifier field 646—its content distinguishes occurrences of instructionsin the generic vector instruction format that specify memory access fromthose that do not; that is, between no memory access 605 instructiontemplates and memory access 620 instruction templates. Memory accessoperations read and/or write to the memory hierarchy (in some casesspecifying the source and/or destination addresses using values inregisters), while non-memory access operations do not (e.g., the sourceand destinations are registers). While in one embodiment this field alsoselects between three different ways to perform memory addresscalculations, alternative embodiments may support more, less, ordifferent ways to perform memory address calculations.

Augmentation operation field 650—its content distinguishes which one ofa variety of different operations to be performed in addition to thebase operation. This field is context specific. In one embodiment of theinvention, this field is divided into a class field 668, an alpha field652, and a beta field 654. The augmentation operation field allowscommon groups of operations to be performed in a single instructionrather than 2, 3 or 4 instructions. Below are some examples ofinstructions (the nomenclature of which are described in more detaillater herein) that use the augmentation field 650 to reduce the numberof required instructions.

Instructions Sequences according to Prior Instruction Sequences onEmbodiment of the Invention vaddps ymm0, ymm1, ymm2 vaddps zmm0, zmm1,zmm2 vpshufd ymm2, ymm2, 0x55 vaddps zmm0, zmm1, zmm2 {bbbb} vaddpsymm0, ymm1, ymm2 vpmovsxbd ymm2, [rax] vaddps zmm0, zmm1, [rax]{sint8}vcvtdq2ps ymm2, ymm2 vaddps ymm0, ymm1, ymm2 vpmovsxbd ymm3, [rax]vaddps zmm1{k5}, zmm2, vcvtdq2ps ymm3, ymm3 [rax]{sint8} vaddps ymm4,ymm2, ymm3 vblendvps ymm1, ymm5, ymm1, ymm4 vmaskmovps ymm1, ymm7, [rbx]vmovaps zmm1 {k7}, [rbx] vbroadcastss ymm0, [rax] vaddps zmm2{k7}{z},zmm1, vaddps ymm2, ymm0, ymm1 [rax]{1toN} vblendvps ymm2, ymm2, ymm1,ymm7

Where [rax] is the base pointer to be used for address generation, andwhere { } indicates a conversion operation specified by the datamanipulation filed (described in more detail later here).

Scale field 660—its content allows for the scaling of the index field'scontent for memory address generation (e.g., for address generation thatuses 2^(scale)*index+base).

Displacement Field 662A—its content is used as part of memory addressgeneration (e.g., for address generation that uses2^(scale)*index+base+displacement).

Displacement Factor Field 662B (note that the juxtaposition ofdisplacement field 662A directly over displacement factor field 662Bindicates one or the other is used)—its content is used as part ofaddress generation; it specifies a displacement factor that is to bescaled by the size of a memory access (N)—where N is the number of bytesin the memory access (e.g., for address generation that uses2^(scale)*index+base+scaled displacement). Redundant low-order bits areignored and hence, the displacement factor field's content is multipliedby the memory operands total size (N) in order to generate the finaldisplacement to be used in calculating an effective address. The valueof N is determined by the processor hardware at runtime based on thefull opcode field 674 (described later herein) and the data manipulationfield 654C as described later herein. The displacement field 662A andthe displacement factor field 662B are optional in the sense that theyare not used for the no memory access 605 instruction templates and/ordifferent embodiments may implement only one or none of the two.

Data element width field 664—its content distinguishes which one of anumber of data element widths is to be used (in some embodiments for allinstructions; in other embodiments for only some of the instructions).This field is optional in the sense that it is not needed if only onedata element width is supported and/or data element widths are supportedusing some aspect of the opcodes.

Write mask field 670—its content controls, on a per data elementposition basis, whether that data element position in the destinationvector operand reflects the result of the base operation andaugmentation operation. Class A instruction templates supportmerging-writemasking, while class B instruction templates support bothmerging- and zeroing-writemasking. When merging, vector masks allow anyset of elements in the destination to be protected from updates duringthe execution of any operation (specified by the base operation and theaugmentation operation); in other one embodiment, preserving the oldvalue of each element of the destination where the corresponding maskbit has a 0. In contrast, when zeroing vector masks allow any set ofelements in the destination to be zeroed during the execution of anyoperation (specified by the base operation and the augmentationoperation); in one embodiment, an element of the destination is set to 0when the corresponding mask bit has a 0 value. A subset of thisfunctionality is the ability to control the vector length of theoperation being performed (that is, the span of elements being modified,from the first to the last one); however, it is not necessary that theelements that are modified be consecutive. Thus, the write mask field670 allows for partial vector operations, including loads, stores,arithmetic, logical, etc. Also, this masking can be used for faultsuppression (i.e., by masking the destination's data element positionsto prevent receipt of the result of any operation that may/will cause afault—e.g., assume that a vector in memory crosses a page boundary andthat the first page but not the second page would cause a page fault,the page fault can be ignored if all data element of the vector that lieon the first page are masked by the write mask). Further, write masksallow for “vectorizing loops” that contain certain types of conditionalstatements. While embodiments of the invention are described in whichthe write mask field's 670 content selects one of a number of write maskregisters that contains the write mask to be used (and thus the writemask field's 670 content indirectly identifies that masking to beperformed), alternative embodiments instead or additional allow the maskwrite field's 670 content to directly specify the masking to beperformed. Further, zeroing allows for performance improvements when: 1)register renaming is used on instructions whose destination operand isnot also a source (also call non-ternary instructions) because duringthe register renaming pipeline stage the destination is no longer animplicit source (no data elements from the current destination registerneed be copied to the renamed destination register or somehow carriedalong with the operation because any data element that is not the resultof operation (any masked data element) will be zeroed); and 2) duringthe write back stage because zeros are being written.

Immediate field 672—its content allows for the specification of animmediate. This field is optional in the sense that is it not present inan implementation of the generic vector friendly format that does notsupport immediate and it is not present in instructions that do not usean immediate.

Instruction Template Class Selection

Class field 668—its content distinguishes between different classes ofinstructions. With reference to FIGS. 2a-b , the contents of this fieldselect between class A and class B instructions. In FIGS. 6a-b , roundedcorner squares are used to indicate a specific value is present in afield (e.g., class A 668A and class B 668B for the class field 668respectively in FIGS. 6a-b ).

No-Memory Access Instruction Templates of Class A

In the case of the non-memory access 605 instruction templates of classA, the alpha field 652 is interpreted as an RS field 652A, whose contentdistinguishes which one of the different augmentation operation typesare to be performed (e.g., round 652A.1 and data transform 652A.2 arerespectively specified for the no memory access, round type operation610 and the no memory access, data transform type operation 615instruction templates), while the beta field 654 distinguishes which ofthe operations of the specified type is to be performed. In FIG. 6,rounded corner blocks are used to indicate a specific value is present(e.g., no memory access 646A in the modifier field 646; round 652A.1 anddata transform 652A.2 for alpha field 652/rs field 652A). In the nomemory access 605 instruction templates, the scale field 660, thedisplacement field 662A, and the displacement scale filed 662B are notpresent.

No-Memory Access Instruction Templates—Full Round Control Type Operation

In the no memory access full round control type operation 610instruction template, the beta field 654 is interpreted as a roundcontrol field 654A, whose content(s) provide static rounding. While inthe described embodiments of the invention the round control field 654Aincludes a suppress all floating point exceptions (SAE) field 656 and around operation control field 658, alternative embodiments may supportmay encode both these concepts into the same field or only have one orthe other of these concepts/fields (e.g., may have only the roundoperation control field 658).

SAE field 656—its content distinguishes whether or not to disable theexception event reporting; when the SAE field's 656 content indicatessuppression is enabled, a given instruction does not report any kind offloating-point exception flag and does not raise any floating pointexception handler.

Round operation control field 658—its content distinguishes which one ofa group of rounding operations to perform (e.g., Round-up, Round-down,Round-towards-zero and Round-to -nearest). Thus, the round operationcontrol field 658 allows for the changing of the rounding mode on a perinstruction basis, and thus is particularly useful when this isrequired. In one embodiment of the invention where a processor includesa control register for specifying rounding modes, the round operationcontrol field's 658 content overrides that register value (Being able tochoose the rounding mode without having to perform a save-modify-restoreon such a control register is advantageous).

No Memory Access Instruction Templates—Data Transform Type Operation

In the no memory access data transform type operation 615 instructiontemplate, the beta field 654 is interpreted as a data transform field654B, whose content distinguishes which one of a number of datatransforms is to be performed (e.g., no data transform, swizzle,broadcast).

Memory Access Instruction Templates of Class A

In the case of a memory access 620 instruction template of class A, thealpha field 652 is interpreted as an eviction hint field 652B, whosecontent distinguishes which one of the eviction hints is to be used (inFIG. 6A, temporal 652B.1 and non-temporal 652B.2 are respectivelyspecified for the memory access, temporal 625 instruction template andthe memory access, non-temporal 630 instruction template), while thebeta field 654 is interpreted as a data manipulation field 654C, whosecontent distinguishes which one of a number of data manipulationoperations (also known as primitives) is to be performed (e.g., nomanipulation; broadcast; up conversion of a source; and down conversionof a destination). The memory access 620 instruction templates includethe scale field 660, and optionally the displacement field 662A or thedisplacement scale field 662B.

Vector Memory Instructions perform vector loads from and vector storesto memory, with conversion support. As with regular vector instructions,vector memory instructions transfer data from/to memory in a dataelement-wise fashion, with the elements that are actually transferreddictated by the contents of the vector mask that is selected as thewrite mask. In FIG. 6A, rounded corner squares are used to indicate aspecific value is present in a field (e.g., memory access 646B for themodifier field 646; temporal 652B.1 and non-temporal 652B.2 for thealpha field 652/eviction hint field 652B).

Memory Access Instruction Templates—Temporal

Temporal data is data likely to be reused soon enough to benefit fromcaching. This is, however, a hint, and different processors mayimplement it in different ways, including ignoring the hint entirely.

Memory Access Instruction Templates—Non-Temporal

Non-temporal data is data unlikely to be reused soon enough to benefitfrom caching in the 1st-level cache and should be given priority foreviction. This is, however, a hint, and different processors mayimplement it in different ways, including ignoring the hint entirely.

Instruction Templates of Class B

In the case of the instruction templates of class B, the alpha field 652is interpreted as a write mask control (Z) field 652C, whose contentdistinguishes whether the write masking controlled by the write maskfield 670 should be a merging or a zeroing.

No-Memory Access Instruction Templates of Class B

In the case of the non-memory access 605 instruction templates of classB, part of the beta field 654 is interpreted as an RL field 652A, whosecontent distinguishes which one of the different augmentation operationtypes are to be performed (e.g., round 657A.1 and vector length (VSIZE)657A.2 are respectively specified for the no memory access, write maskcontrol, partial round control type operation 612 instruction templateand the no memory access, write mask control, VSIZE type operation 617instruction template), while the rest of the beta field 654distinguishes which of the operations of the specified type is to beperformed. In FIG. 6, rounded corner blocks are used to indicate aspecific value is present (e.g., no memory access 646A in the modifierfield 646; round 657A.1 and VSIZE 657A.2 for the RL field 652A). In theno memory access 605 instruction templates, the scale field 660, thedisplacement field 662A, and the displacement scale filed 662B are notpresent.

No-Memory Access Instruction Templates—Write Mask Control, Partial RoundControl Type Operation

In the no memory access, write mask control, partial round control typeoperation 610 instruction template, the rest of the beta field 654 isinterpreted as a round operation field 659A and exception eventreporting is disabled (a given instruction does not report any kind offloating-point exception flag and does not raise any floating pointexception handler).

Round operation control field 659A—just as round operation control field658, its content distinguishes which one of a group of roundingoperations to perform (e.g., Round-up, Round-down, Round-towards-zeroand Round-to-nearest). Thus, the round operation control field 659Aallows for the changing of the rounding mode on a per instruction basis,and thus is particularly useful when this is required. In one embodimentof the invention where a processor includes a control register forspecifying rounding modes, the round operation control field's 659Acontent overrides that register value (Being able to choose the roundingmode without having to perform a save-modify-restore on such a controlregister is advantageous).

No Memory Access Instruction Templates—Write Mask Control, VSIZE TypeOperation

In the no memory access, write mask control, VSIZE type operation 617instruction template, the rest of the beta field 654 is interpreted as avector length field 659B, whose content distinguishes which one of anumber of data vector length is to be performed on (e.g., 128, 856, or1012 byte).

Memory Access Instruction Templates of Class B

In the case of a memory access 620 instruction template of class A, partof the beta field 654 is interpreted as a broadcast field 657B, whosecontent distinguishes whether or not the broadcast type datamanipulation operation is to be performed, while the rest of the betafield 654 is interpreted the vector length field 659B. The memory access620 instruction templates include the scale field 660, and optionallythe displacement field 662A or the displacement scale field 662B.

Additional Comments Regarding Fields

With regard to the generic vector friendly instruction format 600, afull opcode field 674 is shown including the format field 640, the baseoperation field 642, and the data element width field 664. While oneembodiment is shown where the full opcode field 674 includes all ofthese fields, the full opcode field 674 includes less than all of thesefields in embodiments that do not support all of them. The full opcodefield 674 provides the operation code.

The augmentation operation field 650, the data element width field 664,and the write mask field 670 allow these features to be specified on aper instruction basis in the generic vector friendly instruction format.

The combination of write mask field and data element width field createtyped instructions in that they allow the mask to be applied based ondifferent data element widths.

The instruction format requires a relatively small number of bitsbecause it reuses different fields for different purposes based on thecontents of other fields. For instance, one perspective is that themodifier field's content chooses between the no memory access 605instructions templates on FIGS. 6A-B and the memory access 620instruction templates on FIGS. 6Aa-b; while the class field 668'scontent chooses within those non-memory access 605 instruction templatesbetween instruction templates 610/615 of FIGS. 6a and 612/617 of FIG. 6b; and while the class field 668's content chooses within those memoryaccess 620 instruction templates between instruction templates 625/630of FIGS. 6a and 627 of FIG. 6b . From another perspective, the classfield 668's content chooses between the class A and class B instructiontemplates respectively of FIGS. 6a and b; while the modifier field'scontent chooses within those class A instruction templates betweeninstruction templates 605 and 620 of FIG. 6A; and while the modifierfield's content chooses within those class B instruction templatesbetween instruction templates 605 and 620 of FIG. 6b . In the case ofthe class field's content indicating a class A instruction template, thecontent of the modifier field 646 chooses the interpretation of thealpha field 652 (between the rs field 652A and the EH field 652B. In arelated manner, the contents of the modifier field 646 and the classfield 668 chose whether the alpha field is interpreted as the rs field652A, the EH field 652B, or the write mask control (Z) field 652C. Inthe case of the class and modifier fields indicating a class A no memoryaccess operation, the interpretation of the augmentation field's betafield changes based on the rs field's content; while in the case of theclass and modifier fields indicating a class B no memory accessoperation, the interpretation of the beta field depends on the contentsof the RL field. In the case of the class and modifier fields indicatinga class A memory access operation, the interpretation of theaugmentation field's beta field changes based on the base operationfield's content; while in the case of the class and modifier fieldsindicating a class B memory access operation, the interpretation of theaugmentation field's beta field's broadcast field 657B changes based onthe base operation field's contents. Thus, the combination of the baseoperation field, modifier field and the augmentation operation fieldallow for an even wider variety of augmentation operations to bespecified.

The various instruction templates found within class A and class B arebeneficial in different situations. Class A is useful whenzeroing-writemasking or smaller vector lengths are desired forperformance reasons. For example, zeroing allows avoiding fakedependences when renaming is used since we no longer need toartificially merge with the destination; as another example, vectorlength control eases store-load forwarding issues when emulating shortervector sizes with the vector mask. Class B is useful when it isdesirable to: 1) allow floating point exceptions (i.e., when thecontents of the SAE field indicate no) while using rounding-modecontrols at the same time; 2) be able to use upconversion, swizzling,swap, and/or downconversion; 3) operate on the graphics data type. Forinstance, upconversion, swizzling, swap, downconversion, and thegraphics data type reduce the number of instructions required whenworking with sources in a different format; as another example, theability to allow exceptions provides full IEEE compliance with directedrounding-modes.

Exemplary Specific Vector Friendly Instruction Format

FIG. 7 is a block diagram illustrating an exemplary specific vectorfriendly instruction format according to embodiments of the invention.FIG. 7 shows a specific vector friendly instruction format 700 that isspecific in the sense that it specifies the location, size,interpretation, and order of the fields, as well as values for some ofthose fields. The specific vector friendly instruction format 700 may beused to extend the x86 instruction set, and thus some of the fields aresimilar or the same as those used in the existing x86 instruction setand extension thereof (e.g., AVX). This format remains consistent withthe prefix encoding field, real opcode byte field, MOD R/M field, SIBfield, displacement field, and immediate fields of the existing x86instruction set with extensions. The fields from FIG. 6 into which thefields from FIG. 7 map are illustrated.

It should be understand that although embodiments of the invention aredescribed with reference to the specific vector friendly instructionformat 700 in the context of the generic vector friendly instructionformat 600 for illustrative purposes, the invention is not limited tothe specific vector friendly instruction format 700 except whereclaimed. For example, the generic vector friendly instruction format 600contemplates a variety of possible sizes for the various fields, whilethe specific vector friendly instruction format 700 is shown as havingfields of specific sizes. By way of specific example, while the dataelement width field 664 is illustrated as a one bit field in thespecific vector friendly instruction format 700, the invention is not solimited (that is, the generic vector friendly instruction format 600contemplates other sizes of the data element width field 664).

Format—FIG. 7

The generic vector friendly instruction format 600 includes thefollowing fields listed below in the order illustrated in FIG. 7.

EVEX Prefix (Bytes 0-3)

EVEX Prefix 702—is encoded in a four-byte form.

Format Field 640 (EVEX Byte 0, bits [7:0])—the first byte (EVEX Byte 0)is the format field 640 and it contains 0x62 (the unique value used fordistinguishing the vector friendly instruction format in one embodimentof the invention).

The second-fourth bytes (EVEX Bytes 1-3) include a number of bit fieldsproviding specific capability.

REX field 705 (EVEX Byte 1, bits [7-5])—consists of a EVEX.R bit field(EVEX Byte 1, bit [7]—R), EVEX.X bit field (EVEX byte 1, bit [6]—X), andEVEX.B bit field (EVEX byte 1, bit[5]—B). The EVEX.R, EVEX.X, and EVEX.Bbit fields provide the same functionality as the corresponding VEX bitfields, and are encoded using is complement form, i.e. ZMM0 is encodedas 1111B, ZMM15 is encoded as 0000B. Other fields of the instructionsencode the lower three bits of the register indexes as is known in theart (rrr, xxx, and bbb), so that Rrrr, Xxxx, and Bbbb may be formed byadding EVEX.R, EVEX.X, and EVEX.B.

REX′ field 710—this is the first part of the REX′ field 710 and is theEVEX.R′ bit field (EVEX Byte 1, bit [4]—R′) that is used to encodeeither the upper 16 or lower 16 of the extended 32 register set. In oneembodiment of the invention, this bit, along with others as indicatedbelow, is stored in bit inverted format to distinguish (in thewell-known x86 32-bit mode) from the BOUND instruction, whose realopcode byte is 62, but does not accept in the MOD R/M field (describedbelow) the value of 11 in the MOD field; alternative embodiments of theinvention do not store this and the other indicated bits below in theinverted format. A value of 1 is used to encode the lower 16 registers.In other words, R′Rrrr is formed by combining EVEX.R′, EVEX.R, and theother RRR from other fields.

Opcode map field 715 (EVEX byte 1, bits [3:0]—mmmm)—its content encodesan implied leading opcode byte (0F, 0F 38, or 0F 3).

Data element width field 664 (EVEX byte 2, bit [7]—W)—is represented bythe notation EVEX.W. EVEX.W is used to define the granularity (size) ofthe datatype (either 32-bit data elements or 64-bit data elements).

EVEX.vvvv 720 (EVEX Byte 2, bits [6:3]-vvvv)—the role of EVEX.vvvv mayinclude the following: 1) EVEX.vvvv encodes the first source registeroperand, specified in inverted (1s complement) form and is valid forinstructions with 2 or more source operands; 2) EVEX.vvvv encodes thedestination register operand, specified in 1s complement form forcertain vector shifts; or 3) EVEX.vvvv does not encode any operand, thefield is reserved and should contain 1111b. Thus, EVEX.vvvv field 720encodes the 4 low-order bits of the first source register specifierstored in inverted (1s complement) form. Depending on the instruction,an extra different EVEX bit field is used to extend the specifier sizeto 32 registers.

EVEX.U 668 Class field (EVEX byte 2, bit [2]-U)—If EVEX.U=0, itindicates class A or EVEX.U0; if EVEX.U=1, it indicates class B orEVEX.U1.

Prefix encoding field 725 (EVEX byte 2, bits [1:0]-pp)—providesadditional bits for the base operation field. In addition to providingsupport for the legacy SSE instructions in the EVEX prefix format, thisalso has the benefit of compacting the SIMD prefix (rather thanrequiring a byte to express the SIMD prefix, the EVEX prefix requiresonly 2 bits). In one embodiment, to support legacy SSE instructions thatuse a SIMD prefix (66H, F2H, F3H) in both the legacy format and in theEVEX prefix format, these legacy SIMD prefixes are encoded into the SIMDprefix encoding field; and at runtime are expanded into the legacy SIMDprefix prior to being provided to the decoder's PLA (so the PLA canexecute both the legacy and EVEX format of these legacy instructionswithout modification). Although newer instructions could use the EVEXprefix encoding field's content directly as an opcode extension, certainembodiments expand in a similar fashion for consistency but allow fordifferent meanings to be specified by these legacy SIMD prefixes. Analternative embodiment may redesign the PLA to support the 2 bit SIMDprefix encodings, and thus not require the expansion.

Alpha field 652 (EVEX byte 3, bit [7]—EH; also known as EVEX.EH,EVEX.rs, EVEX.RL, EVEX.write mask control, and EVEX.N; also illustratedwith α)—as previously described, this field is context specific.Additional description is provided later herein.

Beta field 654 (EVEX byte 3, bits [6:4]-SSS, also known as EVEX.s₂₋₀,EVEX.r₂₋₀, EVEX.rr1, EVEX.LL0, EVEX.LLB; also illustrated with βββ)—aspreviously described, this field is context specific. Additionaldescription is provided later herein.

REX′ field 710—this is the remainder of the REX′ field and is theEVEX.V′ bit field (EVEX Byte 3, bit [3]—V′) that may be used to encodeeither the upper 16 or lower 16 of the extended 32 register set. Thisbit is stored in bit inverted format. A value of 1 is used to encode thelower 16 registers. In other words, V′VVVV is formed by combiningEVEX.V′, EVEX.vvvv.

Write mask field 670 (EVEX byte 3, bits [2:0]-kkk)—its content specifiesthe index of a register in the write mask registers as previouslydescribed. In one embodiment of the invention, the specific valueEVEX.kkk=000 has a special behavior implying no write mask is used forthe particular instruction (this may be implemented in a variety of waysincluding the use of a write mask hardwired to all ones or hardware thatbypasses the masking hardware).

Real Opcode Field 730 (Byte 4)

This is also known as the opcode byte. Part of the opcode is specifiedin this field.

MOD R/M Field 740 (Byte 5)

Modifier field 646 (MODR/M.MOD, bits [7-6]—MOD field 742)—As previouslydescribed, the MOD field's 742 content distinguishes between memoryaccess and non-memory access operations. This field will be furtherdescribed later herein.

MODR/M.reg field 744, bits [5-3]—the role of ModR/M.reg field can besummarized to two situations: ModR/M.reg encodes either the destinationregister operand or a source register operand, or ModR/M.reg is treatedas an opcode extension and not used to encode any instruction operand.

MODR/M.r/m field 746, bits [2-0]—The role of ModR/M.r/m field mayinclude the following: ModR/M.r/m encodes the instruction operand thatreferences a memory address, or ModR/M.r/m encodes either thedestination register operand or a source register operand.

Scale, Index, Base (SIB) Byte (Byte 6)

Scale field 660 (SIB.SS, bits [7-6]—As previously described, the scalefield's 660 content is used for memory address generation. This fieldwill be further described later herein.

SIB.xxx 754 (bits [5-3] and SIB.bbb 756 (bits [2-0])—the contents ofthese fields have been previously referred to with regard to theregister indexes Xxxx and Bbbb.

Displacement Byte(s) (Byte 7 or Bytes 7-10)

Displacement field 662A (Bytes 7-10)—when MOD field 742 contains 10,bytes 7-10 are the displacement field 662A, and it works the same as thelegacy 32-bit displacement (disp32) and works at byte granularity.

Displacement factor field 662B (Byte 7)—when MOD field 742 contains 01,byte 7 is the displacement factor field 662B. The location of this fieldis that same as that of the legacy x86 instruction set 8-bitdisplacement (disp8), which works at byte granularity. Since disp8 issign extended, it can only address between −128 and 127 bytes offsets;in terms of 64 byte cache lines, disp8 uses 8 bits that can be set toonly four really useful values −128, −64, 0, and 64; since a greaterrange is often needed, disp32 is used; however, disp32 requires 4 bytes.In contrast to disp8 and disp32, the displacement factor field 662B is areinterpretation of disp8; when using displacement factor field 662B,the actual displacement is determined by the content of the displacementfactor field multiplied by the size of the memory operand access (N).This type of displacement is referred to as disp8*N. This reduces theaverage instruction length (a single byte of used for the displacementbut with a much greater range). Such compressed displacement is based onthe assumption that the effective displacement is multiple of thegranularity of the memory access, and hence, the redundant low-orderbits of the address offset do not need to be encoded. In other words,the displacement factor field 662B substitutes the legacy x86instruction set 8-bit displacement. Thus, the displacement factor field662B is encoded the same way as an x86 instruction set 8-bitdisplacement (so no changes in the ModRM/SIB encoding rules) with theonly exception that disp8 is overloaded to disp8*N. In other words,there are no changes in the encoding rules or encoding lengths but onlyin the interpretation of the displacement value by hardware (which needsto scale the displacement by the size of the memory operand to obtain abyte-wise address offset).

Immediate

Immediate field 672 operates as previously described.

Exemplary Register Architecture—FIG. 8

FIG. 8 is a block diagram of a register architecture 800 according toone embodiment of the invention. The register files and registers of theregister architecture are listed below:

Vector register file 810—in the embodiment illustrated, there are 32vector registers that are 512 bits wide; these registers are referencedas zmm0 through zmm31. The lower order 256 bits of the lower 16 zmmregisters are overlaid on registers ymm0-16. The lower order 128 bits ofthe lower 16 zmm registers (the lower order 128 bits of the ymmregisters) are overlaid on registers xmm0-15. The specific vectorfriendly instruction format 700 operates on these overlaid register fileas illustrated in the below tables.

Adjustable Vector Length Class Operations Registers Instruction A (FIG.6A; 810, 615, 625, zmm registers Templates that U = 0) 630 (the vectordo not include length is 64 the vector byte) length field B (FIG. 6B;812 zmm registers 659B U = 1) (the vector length is 64 byte) InstructionB (FIG. 6B; 817, 627 zmm, ymm, or Templates that U = 1) xmm registers doinclude the (the vector vector length length is 64 field 659B byte, 32byte, or 16 byte) depending on the vector length field 659B

In other words, the vector length field 659B selects between a maximumlength and one or more other shorter lengths, where each such shorterlength is half the length of the preceding length; and instructionstemplates without the vector length field 659B operate on the maximumvector length. Further, in one embodiment, the class B instructiontemplates of the specific vector friendly instruction format 700 operateon packed or scalar single/double-precision floating point data andpacked or scalar integer data. Scalar operations are operationsperformed on the lowest order data element position in an zmm/ymm/xmmregister; the higher order data element positions are either left thesame as they were prior to the instruction or zeroed depending on theembodiment.

Write mask registers 815—in the embodiment illustrated, there are 8write mask registers (k0 through k7), each 64 bits in size. Aspreviously described, in one embodiment of the invention the vector maskregister k0 cannot be used as a write mask; when the encoding that wouldnormally indicate k0 is used for a write mask, it selects a hardwiredwrite mask of 0xFFFF, effectively disabling write masking for thatinstruction.

Multimedia Extensions Control Status Register (MXCSR) 820—in theembodiment illustrated, this 32-bit register provides status and controlbits used in floating-point operations.

General-purpose registers 825—in the embodiment illustrated, there aresixteen 64-bit general-purpose registers that are used along with theexisting x86 addressing modes to address memory operands. Theseregisters are referenced by the names RAX, RBX, RCX, RDX, RBP, RSI, RDI,RSP, and R8 through R15.

Extended flags (EFLAGS) register 830—in the embodiment illustrated, this32 bit register is used to record the results of many instructions.

Floating Point Control Word (FCW) register 835 and Floating Point StatusWord (FSW) register 840—in the embodiment illustrated, these registersare used by x87 instruction set extensions to set rounding modes,exception masks and flags in the case of the FCW, and to keep track ofexceptions in the case of the FSW.

Scalar floating point stack register file (x87 stack) 845 on which isaliased the MMX packed integer flat register file 850—in the embodimentillustrated, the x87 stack is an eight-element stack used to performscalar floating-point operations on 32/64/80-bit floating point datausing the x87 instruction set extension; while the MMX registers areused to perform operations on 64-bit packed integer data, as well as tohold operands for some operations performed between the MMX and XMMregisters.

Segment registers 855—in the illustrated embodiment, there are six 16bit registers use to store data used for segmented address generation.

RIP register 865—in the illustrated embodiment, this 64 bit registerthat stores the instruction pointer.

Alternative embodiments of the invention may use wider or narrowerregisters. Additionally, alternative embodiments of the invention mayuse more, less, or different register files and registers.

Exemplary In-Order Processor Architecture—FIGS. 9A-9B

FIGS. 9a-b illustrate a block diagram of an exemplary in-order processorarchitecture. These exemplary embodiments are designed around multipleinstantiations of an in-order CPU core that is augmented with a widevector processor (VPU). Cores communicate through a high-bandwidthinterconnect network with some fixed function logic, memory I/Ointerfaces, and other necessary I/O logic, depending on the e13tapplication. For example, an implementation of this embodiment as astand-alone GPU would typically include a PCIe bus.

FIG. 9a is a block diagram of a single CPU core, along with itsconnection to the on-die interconnect network 902 and with its localsubset of the level 2 (L2) cache 904, according to embodiments of theinvention. An instruction decoder 900 supports the x86 instruction setwith an extension including the specific vector instruction format 700.While in one embodiment of the invention (to simplify the design) ascalar unit 908 and a vector unit 910 use separate register sets(respectively, scalar registers 912 and vector registers 914) and datatransferred between them is written to memory and then read back in froma level 1 (L1) cache 906, alternative embodiments of the invention mayuse a different approach (e.g., use a single register set or include acommunication path that allow data to be transferred between the tworegister files without being written and read back).

The L1 cache 906 allows low-latency accesses to cache memory into thescalar and vector units. Together with load-op instructions in thevector friendly instruction format, this means that the L1 cache 906 canbe treated somewhat like an extended register file. This significantlyimproves the performance of many algorithms, especially with theeviction hint field 652B.

The local subset of the L2 cache 904 is part of a global L2 cache thatis divided into separate local subsets, one per CPU core. Each CPU has adirect access path to its own local subset of the L2 cache 904. Dataread by a CPU core is stored in its L2 cache subset 904 and can beaccessed quickly, in parallel with other CPUs accessing their own localL2 cache subsets. Data written by a CPU core is stored in its own L2cache subset 904 and is flushed from other subsets, if necessary. Thering network ensures coherency for shared data.

FIG. 9b is an exploded view of part of the CPU core in FIG. 9A accordingto embodiments of the invention. FIG. 9b includes an L1 data cache 906Apart of the L1 cache 904, as well as more detail regarding the vectorunit 910 and the vector registers 914. Specifically, the vector unit 910is a 16-wide vector processing unit (VPU) (see the 16-wide ALU 928),which executes integer, single-precision float, and double-precisionfloat instructions. The VPU supports swizzling the register inputs withswizzle unit 920, numeric conversion with numeric convert units 922A-B,and replication with replication unit 924 on the memory input. Writemask registers 926 allow predicating the resulting vector writes.

Register data can be swizzled in a variety of ways, e.g. to supportmatrix multiplication. Data from memory can be replicated across the VPUlanes. This is a common operation in both graphics and non-graphicsparallel data processing, which significantly increases the cacheefficiency.

The ring network is bi-directional to allow agents such as CPU cores, L2caches and other logic blocks to communicate with each other within thechip. Each ring data-path is 812-bits wide per direction.

Exemplary Out-of-order Architecture—FIG. 10

FIG. 10 is a block diagram illustrating an exemplary out-of-orderarchitecture according to embodiments of the invention and can be viewedas a more specific description of a pipeline such as the pipelinediscussed above in FIG. 1. Specifically, FIG. 10 illustrates awell-known exemplary out-of-order architecture that has been modified toincorporate the vector friendly instruction format and executionthereof. In FIG. 10 arrows denotes a coupling between two or more unitsand the direction of the arrow indicates a direction of data flowbetween those units. FIG. 10 includes a front end unit 1005 coupled toan execution engine unit 1010 and a memory unit 1015; the executionengine unit 1010 is further coupled to the memory unit 1015.

The front end unit 1005 includes a level 1 (L1) branch prediction unit1020 coupled to a level 2 (L2) branch prediction unit 1022. The L1 andL2 brand prediction units 1020 and 1022 are coupled to an L1 instructioncache unit 1024. The L1 instruction cache unit 1024 is coupled to aninstruction translation lookaside buffer (TLB) 1026 which is furthercoupled to an instruction fetch and predecode unit 1028. The instructionfetch and predecode unit 1028 is coupled to an instruction queue unit1030 which is further coupled a decode unit 1032. The decode unit 1032comprises a complex decoder unit 1034 and three simple decoder units1036, 1038, and 1040. The decode unit 1032 includes a micro-code ROMunit 1042. The decode unit 1032 may operate as previously describedabove in the decode stage section. The L1 instruction cache unit 1024 isfurther coupled to an L2 cache unit 1048 in the memory unit 1015. Theinstruction TLB unit 1026 is further coupled to a second level TLB unit1046 in the memory unit 1015. The decode unit 1032, the micro-code ROMunit 1042, and a loop stream detector unit 1044 are each coupled to arename/allocator unit 1056 in the execution engine unit 1010.

The execution engine unit 1010 includes the rename/allocator unit 1056that is coupled to a retirement unit 1074 and a unified scheduler unit1058. The retirement unit 1074 is further coupled to execution units1060 and includes a reorder buffer unit 1078. The unified scheduler unit1058 is further coupled to a physical register files unit 1076 which iscoupled to the execution units 1060. The physical register files unit1076 comprises a vector registers unit 1077A, a write mask registersunit 1077B, and a scalar registers unit 1077C; these register units mayprovide the vector registers 810, the vector mask registers 815, and thegeneral purpose registers 825; and the physical register files unit 1076may include additional register files not shown (e.g., the scalarfloating point stack register file 845 aliased on the MMX packed integerflat register file 850). The execution units 1060 include three mixedscalar and vector units 1062, 1064, and 1072; a load unit 1066; a storeaddress unit 1068; a store data unit 1070. The load unit 1066, the storeaddress unit 1068, and the store data unit 1070 are each coupled furtherto a data TLB unit 1052 in the memory unit 1015.

The memory unit 1015 includes the second level TLB unit 1046 which iscoupled to the data TLB unit 1052. The data TLB unit 1052 is coupled toan L1 data cache unit 1054. The L1 data cache unit 1054 is furthercoupled to an L2 cache unit 1048. In some embodiments, the L2 cache unit1048 is further coupled to L3 and higher cache units 1050 inside and/oroutside of the memory unit 1015.

By way of example, the exemplary out-of-order architecture may implementthe process pipeline 8200 as follows: 1) the instruction fetch andpredecode unit 1028 perform the fetch and length decoding stages; 2) thedecode unit 1032 performs the decode stage; 3) the rename/allocator unit1056 performs the allocation stage and renaming stage; 4) the unifiedscheduler 1058 performs the schedule stage; 5) the physical registerfiles unit 1076, the reorder buffer unit 1078, and the memory unit 1015perform the register read/memory read stage; the execution units 1060perform the execute/data transform stage; 6) the memory unit 1015 andthe reorder buffer unit 1078 perform the write back/memory write stage1960; 7) the retirement unit 1074 performs the ROB read stage; 8)various units may be involved in the exception handling stage; and 9)the retirement unit 1074 and the physical register files unit 1076perform the commit stage.

Exemplary Single Core and Multicore Processors—FIG. 15

FIG. 15 is a block diagram of a single core processor and a multicoreprocessor 1500 with integrated memory controller and graphics accordingto embodiments of the invention. The solid lined boxes in FIG. 15illustrate a processor 1500 with a single core 1502A, a system agent1510, a set of one or more bus controller units 1516, while the optionaladdition of the dashed lined boxes illustrates an alternative processor1500 with multiple cores 1502A-N, a set of one or more integrated memorycontroller unit(s) 1514 in the system agent unit 1510, and an integratedgraphics logic 1508.

The memory hierarchy includes one or more levels of cache within thecores, a set or one or more shared cache units 1506, and external memory(not shown) coupled to the set of integrated memory controller units1514. The set of shared cache units 1506 may include one or moremid-level caches, such as level 2 (L2), level 3 (L3), level 4 (L4), orother levels of cache, a last level cache (LLC), and/or combinationsthereof. While in one embodiment a ring based interconnect unit 1512interconnects the integrated graphics logic 1508, the set of sharedcache units 1506, and the system agent unit 1510, alternativeembodiments may use any number of well-known techniques forinterconnecting such units.

In some embodiments, one or more of the cores 1502A-N are capable ofmulti-threading. The system agent 1510 includes those componentscoordinating and operating cores 1502A-N. The system agent unit 1510 mayinclude for example a power control unit (PCU) and a display unit. ThePCU may be or include logic and components needed for regulating thepower state of the cores 1502A-N and the integrated graphics logic 1508.The display unit is for driving one or more externally connecteddisplays.

The cores 1502A-N may be homogenous or heterogeneous in terms ofarchitecture and/or instruction set. For example, some of the cores1502A-N may be in order (e.g., like that shown in FIGS. 9A and 9B) whileothers are out-of-order (e.g., like that shown in FIG. 10). As anotherexample, two or more of the cores 1502A-N may be capable of executingthe same instruction set, while others may be capable of executing onlya subset of that instruction set or a different instruction set. Atleast one of the cores is capable of executing the vector friendlyinstruction format described herein.

The processor may be a general-purpose processor, such as a Core™ i3,i5, i7, 2 Duo and Quad, Xeon™, or Itanium™ processor, which areavailable from Intel Corporation, of Santa Clara, Calif. Alternatively,the processor may be from another company. The processor may be aspecial-purpose processor, such as, for example, a network orcommunication processor, compression engine, graphics processor,co-processor, embedded processor, or the like. The processor may beimplemented on one or more chips. The processor 1500 may be a part ofand/or may be implemented on one or more substrates using any of anumber of process technologies, such as, for example, BiCMOS, CMOS, orNMOS.

Exemplary Computer Systems and Processors—FIGS. 11-13

FIGS. 11-13 are exemplary systems suitable for including the processor1500, while FIG. 15 is an exemplary system on a chip (SoC) that mayinclude one or more of the cores 1502. Other system designs andconfigurations known in the arts for laptops, desktops, handheld PCs,personal digital assistants, engineering workstations, servers, networkdevices, network hubs, switches, embedded processors, digital signalprocessors (DSPs), graphics devices, video game devices, set-top boxes,micro controllers, cell phones, portable media players, hand helddevices, and various other electronic devices, are also suitable. Ingeneral, a huge variety of systems or electronic devices capable ofincorporating a processor and/or other execution logic as disclosedherein are generally suitable.

Referring now to FIG. 11, shown is a block diagram of a system 1100 inaccordance with one embodiment of the invention. The system 1100 mayinclude one or more processors 1110, 1115, which are coupled to graphicsmemory controller hub (GMCH) 1120. The optional nature of additionalprocessors 1115 is denoted in FIG. 11 with broken lines.

Each processor 1110, 1115 may be some version of processor 1500.However, it should be noted that it is unlikely that integrated graphicslogic and integrated memory control units would exist in the processors1110, 1115.

FIG. 11 illustrates that the GMCH 1120 may be coupled to a memory 1140that may be, for example, a dynamic random access memory (DRAM). TheDRAM may, for at least one embodiment, be associated with a non-volatilecache.

The GMCH 1120 may be a chipset, or a portion of a chipset. The GMCH 1120may communicate with the processor(s) 1110, 1115 and control interactionbetween the processor(s) 1110, 1115 and memory 1140. The GMCH 1120 mayalso act as an accelerated bus interface between the processor(s) 1110,1115 and other elements of the system 1100. For at least one embodiment,the GMCH 1120 communicates with the processor(s) 1110, 1115 via amulti-drop bus, such as a frontside bus (FSB) 1195.

Furthermore, GMCH 1120 is coupled to a display 1145 (such as a flatpanel display). GMCH 1120 may include an integrated graphicsaccelerator. GMCH 1120 is further coupled to an input/output (I/O)controller hub (ICH) 1150, which may be used to couple variousperipheral devices to system 1100. Shown for example in the embodimentof FIG. 11 is an external graphics device 1160, which may be a discretegraphics device coupled to ICH 1150, along with another peripheraldevice 1170.

Alternatively, additional or different processors may also be present inthe system 1100. For example, additional processor(s) 1115 may includeadditional processors(s) that are the same as processor 1110, additionalprocessor(s) that are heterogeneous or asymmetric to processor 1110,accelerators (such as, e.g., graphics accelerators or digital signalprocessing (DSP) units), field programmable gate arrays, or any otherprocessor. There can be a variety of differences between the physicalresources 1110, 1115 in terms of a spectrum of metrics of meritincluding architectural, microarchitectural, thermal, power consumptioncharacteristics, and the like. These differences may effectivelymanifest themselves as asymmetry and heterogeneity amongst theprocessing elements 1110, 1115. For at least one embodiment, the variousprocessing elements 1110, 1115 may reside in the same die package.

Referring now to FIG. 12, shown is a block diagram of a second system1200 in accordance with an embodiment of the present invention. As shownin FIG. 12, multiprocessor system 1200 is a point-to-point interconnectsystem, and includes a first processor 1270 and a second processor 1280coupled via a point-to-point interconnect 1250. As shown in FIG. 12,each of processors 1270 and 1280 may be some version of the processor1500.

Alternatively, one or more of processors 1270, 1280 may be an elementother than a processor, such as an accelerator or a field programmablegate array.

While shown with only two processors 1270, 1280, it is to be understoodthat the scope of the present invention is not so limited. In otherembodiments, one or more additional processing elements may be presentin a given processor.

Processor 1270 may further include an integrated memory controller hub(IMC) 1272 and point-to-point (P-P) interfaces 1276 and 1278. Similarly,second processor 1280 may include a IMC 1282 and P-P interfaces 1286 and1288. Processors 1270, 1280 may exchange data via a point-to-point (PtP)interface 1250 using PtP interface circuits 1278, 1288. As shown in FIG.12, IMC's 1272 and 1282 couple the processors to respective memories,namely a memory 1242 and a memory 1244, which may be portions of mainmemory locally attached to the respective processors.

Processors 1270, 1280 may each exchange data with a chipset 1290 viaindividual P-P interfaces 1252, 1254 using point to point interfacecircuits 1276, 1294, 1286, 1298. Chipset 1290 may also exchange datawith a high-performance graphics circuit 1238 via a high-performancegraphics interface 1239.

A shared cache (not shown) may be included in either processor outsideof both processors, yet connected with the processors via P-Pinterconnect, such that either or both processors' local cacheinformation may be stored in the shared cache if a processor is placedinto a low power mode.

Chipset 1290 may be coupled to a first bus 1216 via an interface 1296.In one embodiment, first bus 1216 may be a Peripheral ComponentInterconnect (PCI) bus, or a bus such as a PCI Express bus or anotherthird generation I/O interconnect bus, although the scope of the presentinvention is not so limited.

As shown in FIG. 12, various I/O devices 1214 may be coupled to firstbus 1216, along with a bus bridge 1218 which couples first bus 1216 to asecond bus 1220. In one embodiment, second bus 1220 may be a low pincount (LPC) bus. Various devices may be coupled to second bus 1220including, for example, a keyboard/mouse 1222, communication devices1226 and a data storage unit 1228 such as a disk drive or other massstorage device which may include code 1230, in one embodiment. Further,an audio I/O 1224 may be coupled to second bus 1220. Note that otherarchitectures are possible. For example, instead of the point-to-pointarchitecture of FIG. 12, a system may implement a multi-drop bus orother such architecture.

Referring now to FIG. 13, shown is a block diagram of a third system1300 in accordance with an embodiment of the present invention. Likeelements in FIGS. 12 and 13 bear like reference numerals, and certainaspects of FIG. 12 have been omitted from FIG. 13 in order to avoidobscuring other aspects of FIG. 13.

FIG. 13 illustrates that the processing elements 1270, 1280 may includeintegrated memory and I/O control logic (“CL”) 1272 and 1282,respectively. For at least one embodiment, the CL 1272, 1282 may includememory controller hub logic (IMC) such as that described above inconnection with FIGS. 11 and 12. In addition. CL 1272, 1282 may alsoinclude I/O control logic. FIG. 13 illustrates that not only are thememories 1242, 1244 coupled to the CL 1272, 1282, but also that I/Odevices 1314 are also coupled to the control logic 1272, 1282. LegacyI/O devices 1315 are coupled to the chipset 1290.

Referring now to FIG. 14, shown is a block diagram of a SoC 1400 inaccordance with an embodiment of the present invention. Similar elementsin FIG. 15 bear like reference numerals. Also, dashed lined boxes areoptional features on more advanced SoCs. In FIG. 14, an interconnectunit(s) 1402 is coupled to: an application processor 1410 which includesa set of one or more cores 1502A-N and shared cache unit(s) 1506; asystem agent unit 1510; a bus controller unit(s) 1516; an integratedmemory controller unit(s) 1514; a set or one or more media processors1420 which may include integrated graphics logic 1508, an imageprocessor 1424 for providing still and/or video camera functionality, anaudio processor 1426 for providing hardware audio acceleration, and avideo processor 1428 for providing video encode/decode acceleration; anstatic random access memory (SRAM) unit 1430; a direct memory access(DMA) unit 1432; and a display unit 1440 for coupling to one or moreexternal displays.

Embodiments of the mechanisms disclosed herein may be implemented inhardware, software, firmware, or a combination of such implementationapproaches. Embodiments of the invention may be implemented as computerprograms or program code executing on programmable systems comprising atleast one processor, a storage system (including volatile andnon-volatile memory and/or storage elements), at least one input device,and at least one output device.

Program code may be applied to input data to perform the functionsdescribed herein and generate output information. The output informationmay be applied to one or more output devices, in known fashion. Forpurposes of this application, a processing system includes any systemthat has a processor, such as, for example; a digital signal processor(DSP), a microcontroller, an application specific integrated circuit(ASIC), or a microprocessor.

The program code may be implemented in a high level procedural or objectoriented programming language to communicate with a processing system.The program code may also be implemented in assembly or machinelanguage, if desired. In fact, the mechanisms described herein are notlimited in scope to any particular programming language. In any case,the language may be a compiled or interpreted language.

One or more aspects of at least one embodiment may be implemented byrepresentative instructions stored on a machine-readable medium whichrepresents various logic within the processor, which when read by amachine causes the machine to fabricate logic to perform the techniquesdescribed herein. Such representations, known as “IP cores” may bestored on a tangible, machine readable medium and supplied to variouscustomers or manufacturing facilities to load into the fabricationmachines that actually make the logic or processor.

Such machine-readable storage media may include, without limitation,non-transitory, tangible arrangements of articles manufactured or formedby a machine or device, including storage media such as hard disks, anyother type of disk including floppy disks, optical disks (compact diskread-only memories (CD-ROMs), compact disk rewritables (CD-RWs)), andmagneto-optical disks, semiconductor devices such as read-only memories(ROMs), random access memories (RAMs) such as dynamic random accessmemories (DRAMs), static random access memories (SRAMs), erasableprogrammable read-only memories (EPROMs), flash memories, electricallyerasable programmable read-only memories (EEPROMs), magnetic or opticalcards, or any other type of media suitable for storing electronicinstructions.

Accordingly, embodiments of the invention also include non-transitory,tangible machine-readable media containing instructions the vectorfriendly instruction format or containing design data, such as HardwareDescription Language (HDL), which defines structures, circuits,apparatuses, processors and/or system features described herein. Suchembodiments may also be referred to as program products.

In some cases, an instruction converter may be used to convert aninstruction from a source instruction set to a target instruction set.For example, the instruction converter may translate (e.g., using staticbinary translation, dynamic binary translation including dynamiccompilation), morph, emulate, or otherwise convert an instruction to oneor more other instructions to be processed by the core. The instructionconverter may be implemented in software, hardware, firmware, or acombination thereof. The instruction converter may be on processor, offprocessor, or part on and part off processor.

FIG. 16 is a block diagram contrasting the use of a software instructionconverter to convert binary instructions in a source instruction set tobinary instructions in a target instruction set according to embodimentsof the invention. In the illustrated embodiment, the instructionconverter is a software instruction converter, although alternativelythe instruction converter may be implemented in software, firmware,hardware, or various combinations thereof. FIG. 16 shows a program in ahigh level language 1602 may be compiled using an x86 compiler 1604 togenerate x86 binary code 1606 that may be natively executed by aprocessor with at least one x86 instruction set core 1616 (it is assumethat some of the instructions that were compiled are in the vectorfriendly instruction format). The processor with at least one x86instruction set core 1616 represents any processor that can performsubstantially the same functions as a Intel processor with at least onex86 instruction set core by compatibly executing or otherwise processing(1) a substantial portion of the instruction set of the Intel x86instruction set core or (2) object code versions of applications orother software targeted to run on an Intel processor with at least onex86 instruction set core, in order to achieve substantially the sameresult as an Intel processor with at least one x86 instruction set core.The x86 compiler 1604 represents a compiler that is operable to generatex86 binary code 1606 (e.g., object code) that can, with or withoutadditional linkage processing, be executed on the processor with atleast one x86 instruction set core 1616. Similarly, FIG. 16 shows theprogram in the high level language 1602 may be compiled using analternative instruction set compiler 1608 to generate alternativeinstruction set binary code 1610 that may be natively executed by aprocessor without at least one x86 instruction set core 1614 (e.g., aprocessor with cores that execute the MIPS instruction set of MIPSTechnologies of Sunnyvale, Calif. and/or that execute the ARMinstruction set of ARM Holdings of Sunnyvale, Calif.). The instructionconverter 1612 is used to convert the x86 binary code 1606 into codethat may be natively executed by the processor without an x86instruction set core 1614. This converted code is not likely to be thesame as the alternative instruction set binary code 1610 because aninstruction converter capable of this is difficult to make; however, theconverted code will accomplish the general operation and be made up ofinstructions from the alternative instruction set. Thus, the instructionconverter 1612 represents software, firmware, hardware, or a combinationthereof that, through emulation, simulation or any other process, allowsa processor or other electronic device that does not have an x86instruction set processor or core to execute the x86 binary code 1606.

Certain operations of the instruction(s) in the vector friendlyinstruction format disclosed herein may be performed by hardwarecomponents and may be embodied in machine-executable instructions thatare used to cause, or at least result in, a circuit or other hardwarecomponent programmed with the instructions performing the operations.The circuit may include a general-purpose or special-purpose processor,or logic circuit, to name just a few examples. The operations may alsooptionally be performed by a combination of hardware and software.Execution logic and/or a processor may include specific or particularcircuitry or other logic responsive to a machine instruction or one ormore control signals derived from the machine instruction to store aninstruction specified result operand. For example, embodiments of theinstruction(s) disclosed herein may be executed in one or more thesystems of FIGS. 11-16 and embodiments of the instruction(s) in thevector friendly instruction format may be stored in program code to beexecuted in the systems. Additionally, the processing elements of thesefigures may utilize one of the detailed pipelines and/or architectures(e.g., the in-order and out-of-order architectures) detailed herein. Forexample, the decode unit of the in-order architecture may decode theinstruction(s), pass the decoded instruction to a vector or scalar unit,etc.

The above description is intended to illustrate preferred embodiments ofthe present invention. From the discussion above it should also beapparent that especially in such an area of technology, where growth isfast and further advancements are not easily foreseen, the invention canmay be modified in arrangement and detail by those skilled in the artwithout departing from the principles of the present invention withinthe scope of the accompanying claims and their equivalents. For example,one or more operations of a method may be combined or further brokenapart.

Alternative Embodiments

While embodiments have been described which would natively execute thevector friendly instruction format, alternative embodiments of theinvention may execute the vector friendly instruction format through anemulation layer running on a processor that executes a differentinstruction set (e.g., a processor that executes the MIPS instructionset of MIPS Technologies of Sunnyvale, Calif., a processor that executesthe ARM instruction set of ARM Holdings of Sunnyvale, Calif.). Also,while the flow diagrams in the figures show a particular order ofoperations performed by certain embodiments of the invention, it shouldbe understood that such order is exemplary (e.g., alternativeembodiments may perform the operations in a different order, combinecertain operations, overlap certain operations, etc.).

In the description above, for the purposes of explanation, numerousspecific details have been set forth in order to provide a thoroughunderstanding of the embodiments of the invention. It will be apparenthowever, to one skilled in the art, that one or more other embodimentsmay be practiced without some of these specific details. The particularembodiments described are not provided to limit the invention but toillustrate embodiments of the invention. The scope of the invention isnot to be determined by the specific examples provided above but only bythe claims below.

What is claimed is:
 1. A processor comprising: a decoder to decode aninstruction comprising input operands of a conditional vector withelements that indicate whether a condition of a loop is either true ornot true for each respective iteration of the loop, a base value, and astride; and an execution unit to execute the instruction to provide aresultant output vector, the execution unit to produce an element ineach element position of the resultant output vector by incrementing thebase value by the stride each time the condition is true in acorresponding element position of the conditional vector.
 2. Theprocessor of claim 1 wherein each corresponding element position of theconditional vector is a same element position of the resultant outputvector.
 3. The processor of claim 1 wherein each corresponding elementposition of the conditional vector is an immediately preceding elementposition of the resultant output vector.
 4. The processor of claim 1wherein the base value and the stride are immediate scalar operands. 5.The processor of claim 1 wherein the base value and the stride are eachvector operands.
 6. The processor of claim 1 wherein the instructionprocesses multiple elements of the resultant output vectorsimultaneously in parallel.
 7. The processor of claim 1 wherein theinstruction processes multiple elements of the resultant output vectorserially.
 8. The processor of claim 1 wherein, for a first elementposition of the resultant output vector, a value is the base value. 9.The processor of claim 8 wherein the base value is a carry over from apreceding execution of the instruction.
 10. The processor of claim 8wherein, for an element position of the resultant output vector otherthan the first element position of the resultant output vector, thevalue is a value from an immediately preceding resultant output vectorelement.
 11. A method comprising: decoding an instruction comprisinginput operands of a conditional vector with elements that indicatewhether a condition of a loop is either true or not true for eachrespective iteration of the loop, a base value, and a stride; andexecuting the instruction to provide a resultant output vector byproducing an element in each element position of the resultant outputvector by incrementing the base value by the stride each time thecondition is true in a corresponding element position of the conditionalvector.
 12. The method of claim 11 wherein each corresponding elementposition of the conditional vector is a same element position of theresultant output vector.
 13. The method of claim 11 wherein eachcorresponding element position of the conditional vector is animmediately preceding element position of the resultant output vector.14. The machine method of claim 11 wherein the base value and the strideare immediate scalar operands.
 15. The method of claim 11 wherein thebase value and the stride are each vector operands.
 16. A computingsystem comprising: a system memory; and a processor coupled to thesystem memory, the processor comprising: a decoder to decode aninstruction comprising input operands of a conditional vector withelements that indicate whether a condition of a loop is either true ornot true for each respective iteration of the loop, a base value, and astride, and an execution unit to execute the instruction to provide aresultant output vector, the execution unit to produce an element ineach element position of the resultant output vector by incrementing thebase value by the stride each time the condition is true in acorresponding element position of the conditional vector.
 17. Thecomputing system of claim 16 wherein each corresponding element positionof the conditional vector is a same element position of the resultantoutput vector.
 18. The computing system of claim 16 wherein eachcorresponding element position of the conditional vector is animmediately preceding element position of the resultant output vector.19. The computing system of claim 16 wherein a base value and the strideare immediate scalar operands.
 20. The computing system of claim 16wherein the base value and the stride are each vector operands.